﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharePointROM
{
    /// <summary>
    /// Represents a SharePoint Site
    /// </summary>
    public class SPSite
    {


        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="url">Url of site to connect to</param>
        /// <remarks>Will connect to the SharePoint site using the supplied url</remarks>
        public SPSite(string url)
            : this(new Uri(url))
        { }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="uri">Url of site to connect to</param>
        /// <remarks>Will connect to the SharePoint site using the supplied url</remarks>
        public SPSite(Uri uri)
        {
            Url = uri;
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="url">Url of site to connect to</param>
        /// <param name="userName">Username to use when connecting to site</param>
        /// <param name="password">Password to use when connecting to site</param>
        /// <remarks>Will connect to the SharePoint site using the supplied url, username and password</remarks>
        public SPSite(string url, string userName, string password)
            : this(new Uri(url), userName, password) { }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="url">Url of site to connect to</param>
        /// <param name="userName">Username to use when connecting to site</param>
        /// <param name="password">Password to use when connecting to site</param>
        /// <remarks>Will connect to the SharePoint site using the supplied url, username and password</remarks>
        public SPSite(Uri url, string userName, string password)
            : this(url)
        {
            Username = userName;
            Password = password;
        }

        /// <summary>
        /// Url of SharePoint Site
        /// </summary>
        public Uri Url { get; set; }

        /// <summary>
        /// Username to use when connecting to SharePoint site
        /// </summary>
        public string Username { get; set; }

        /// <summary>
        /// Password to use when connecting to SharePoint site
        /// </summary>
        public string Password { get; set; }

    }
}
